//
//  CustMarco.h
//  ProjectTemplet
//
//  Created by HouKavin on 16/2/2.
//  Copyright © 2016年 HouKavin. All rights reserved.
//

#define kLongMax 9223372036854775807
#define kCtime [[NSDate date] timeIntervalSince1970]*1000

#pragma mark - 颜色宏

//设置颜色，根据RGB和透明度设置
#define kColorSet(r, g, b, a)       [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
//清除颜色
#define kClearColor                 [UIColor clearColor]
//自定义的橙色
#define kOrangeColor          [UIColor colorWithRed:249.0f/255.0f green:215.0f/255.0f  blue:119.0f/255.0f  alpha:1.0f]
//自定义红色
#define kRedColor              [UIColor colorWithRed:255.0f/255.0f green:30.0f/255.0f  blue:30.0f/255.0f  alpha:1.0f]

//自定义绿色
#define KGreenColor [UIColor colorWithRed:68 / 255 green:179.0 / 255 blue:15.0 / 255 alpha:1]

//自定义蓝色
#define kBlueColor [UIColor colorWithRed:137/255.0 green:149/255.0 blue:198/255.0 alpha:1.0]

//自定义灰色
#define kGrayColor  [UIColor colorWithRed:188/255.0 green:192/255.0 blue:192/255.0 alpha:100]

#pragma mark - 字体宏

#define kFont10             [UIFont systemFontOfSize:10.0]
#define kFont12             [UIFont systemFontOfSize:12.0]
#define kFont14             [UIFont systemFontOfSize:14.0]
#define kFont16             [UIFont systemFontOfSize:16.0]
#define kFont18             [UIFont systemFontOfSize:18.0]

#pragma mark - 尺寸宏

//设备屏幕大小
#define __MainScreenFrame   [[UIScreen mainScreen] bounds]
//设备屏幕宽度
#define __MainScreen_Width  __MainScreenFrame.size.width
//设备屏幕高度
#define __MainScreen_Height  __MainScreenFrame.size.height

// View 圆角和加边框
#define kViewBorderRadius(View, Radius, Width, Color)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]]

// View 圆角
#define kViewRadius(View, Radius)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES]

// 获取View的tag值
#define kViewWithTag(_OBJECT, _TAG)\
\
[_OBJECT viewWithTag : _TAG]

#pragma mark - 杂项宏

// View 坐标(x,y)和宽高(width,height)
#define X(v)                    (v).frame.origin.x
#define Y(v)                    (v).frame.origin.y
#define WIDTH(v)                (v).frame.size.width
#define HEIGHT(v)               (v).frame.size.height

// 加载图片
#define kPNGImage(NAME)          [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:(NAME) ofType:@"png"]]
#define kJPGImage(NAME)          [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:(NAME) ofType:@"jpg"]]

//判断文件是否存在
#define kMCIsFileExists(filePath)   [[NSFileManager defaultManager] fileExistsAtPath:filePath]
